package com.itheima.demo01;

import java.io.*;
import java.net.Socket;

public class ClientClass {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",10013);
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("day17_practice\\aaa\\a.jpg"));
        BufferedOutputStream bos = new BufferedOutputStream(socket.getOutputStream());
        int a;
        while ((a = bis.read()) != -1) {
            bos.write(a);
        }
        bos.flush();
        socket.shutdownOutput();

        BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String line;
        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }
        bis.close();
        socket.close();
    }
}
